﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace thinger.MTHControlLib
{
    public partial class TextSetEx : UserControl
    {
        public TextSetEx()
        {
            InitializeComponent();


           
        }

        private string title = "1#站点温度高限";
        [Browsable(true)]
        [Category("自定义属性")]
        [Description("设置名称")]
        public string Title
        {
            get { return title; }
            set
            {
                title = value;
                this.lblTitle.Text = title;
            }
        }

        private float currentValue = 0.0f;
        [Browsable(true)]
        [Category("自定义属性")]
        [Description("设置限定值")]
        public float CurrentValue
        {
            get {
                currentValue = (float)this.nudValue.Value;
                return currentValue; 
                
            }
            set
            {
                if (currentValue != value)
                {
                    currentValue = value;
                    this.nudValue.Value =Convert.ToDecimal(currentValue.ToString().Trim());
                }

            }
        }

        private string unit = "℃";
        [Browsable(true)]
        [Category("自定义属性")]
        [Description("单位")]
        public string Unit
        {
            get { return unit; }
            set
            {
                unit = value;
                this.lblUnit.Text = unit;
                this.Invalidate();
            }
        }
    }
}
